module canvas.sdlkeys;

import canvas.keysyms;
import canvas.keys;
import derelict.sdl.sdl;

public Keycode translateKeyIDToKeycode(char[] keyid) {
    foreach (KeycodeToName item; g_keycode_to_name) {
        if (item.name == keyid) {
            return item.code;
        }
    }
    return Keycode.INVALID;
}

public int translateKeycodeToSDLKey(Keycode code) {
    foreach (SDLToKeycode item; g_sdl_to_code) {
        if (item.code == code) {
            return item.sdlcode;
        }
    }
}

